#include "ShareMemory.hpp"
#include "Time.hpp"
int main()
{
    shm.GetSHM();
    shm.Attach();
    std::cout << "client Attach" << std::endl;

    mypipe.OpenForWrite();
    ////////////////
    // 在此通信
    char *buffer = (char *)shm.GetAddr();
    int i = 0;
    while (true)
    {
        std::string tmp = " ";
        buffer[i] = 'A'; // 向共享内存中写
        // sleep(2);
        i++;
        tmp += GetTime();
        strcpy(buffer + i, tmp.c_str());
        sleep(1);

        mypipe.Signal(); // 发送信号，让其读
    }
    ////////////////
    shm.DeAttach();
    std::cout << "client DeAttach" << std::endl;

    return 0;
}